﻿using System;
using System.Data;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using HiauPdm.Bll;
using HiauPdm.Web;

namespace HiauPdm.Web
{
    public partial class WzXzMain : PageBase
    {
        protected override bool IsAccess()
        {
            return true;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BtnOk.Attributes["onclick"] = "SetResult('" + GridWz.ClientID + "');";
                string sWhere = Request.QueryString["sWhere"];
                if (sWhere == null) { sWhere = string.Empty; }
                string sWzBh = Request.QueryString["sWzBh"];
                if (sWzBh == null) { sWzBh = string.Empty; }
                if (sWhere != string.Empty || sWzBh != string.Empty)
                {
                    DataSet ds = BJcSj.QueryWz(sWhere.Trim(), sWzBh);
                    GridWz.DataSource = ds;
                    GridWz.DataBind();
                }
            }
        }

        protected void GridWz_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes["ondblclick"] = "SetResult('" + GridWz.ClientID + "');";
            }
        }
    }
}